import request from '@/utils/request'

const router = '/pm/project'

export function getList(params) {
  return request({
    url: router,
    method: 'get',
    params
  })
}

export function save(data) {
  let methodName = 'post'
  if (data.id !== 0) {
    methodName = 'put'
  }
  return request({
    url: router,
    method: methodName,
    data 
  })
}
export function saveProjectSupplier(data) {
  let methodName = 'post'
  // if (data.id !== 0) {
  //   methodName = 'put'
  // }
  return request({
    url: `${router}/addProjectSupplier`,
    method: methodName,
    data 
  })
}
export function saveProjectSettlement(data) {
  let methodName = 'post'
  // if (data.id !== 0) {
  //   methodName = 'put'
  // }
  return request({
    url: `${router}/addProjectSettlement`,
    method: methodName,
    data 
  })
}
export function remove(id) {
  return request({
    url: `${router}/${id}`,
    method: 'delete'
  })
}
export function getModeImplementationList() {
  return request({
    url: `${router}/modeImplementation`,
    method: 'get'
  })
}
export function getProjectTaxRate() {
  return request({
    url: `${router}/projectTaxRate`,
    method: 'get'
  })
}
export function getProjectSettlementModel() {
  return request({
    url: `${router}/projectSettlementModel`,
    method: 'get'
  })
}
export function getProjectSettlementType() {
  return request({
    url: `${router}/projectSettlementType`,
    method: 'get'
  })
}
export function getAll() {
  return request({
    url: `${router}/getall`,
    method: 'get'
  })
}
